//
//  QNJsbridge+Navigate.m
//  JSAPIModule
//
//  Created by sumeng on 2018/3/6.
//

#define QN_navigateTo @"navigateTo"
#define QN_redirectTo @"redirectTo"
#define QN_navigateBack @"navigateBack"

#import "QNJsbridge+Navigate.h"

@implementation QNJsbridge (Navigate)

#pragma mark 注册跳转方法
- (void)registerNavigateToResponseBlock:(QN_responseBlock)responseBlock {
    [self registerHandler:QN_navigateTo responseBlock:^(id data) {
        responseBlock(data);
    }];
}

#pragma mark 注册关闭当前页面，跳转到其它页面
- (void)registerRedirectToResponseBlock:(QN_responseBlock)responseBlock {
    [self registerHandler:QN_redirectTo responseBlock:^(id data) {
        responseBlock(data);
    }];
}

#pragma mark 关闭当前页面，返回上一页面
- (void)registerNavigateBackResponseBlock:(QN_responseBlock)responseBlock {
    [self registerHandler:QN_navigateBack responseBlock:^(id data) {
        responseBlock(data);
    }];
}
@end
